<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<%@ include file="/common/taglibs.jsp"%>
<link href="${ctx}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/js/list.js"></script>
<script type="text/javascript" src="${ctx}/resources/admin/datePicker/WdatePicker.js"></script>
<script type="text/javascript">
$().ready(function() {

	var $listForm = $("#listForm");
	var $filterSelect = $("#filterSelect");
	var $filterOption = $("#filterOption a");
	var $print = $("select[name='print']");

	// 订单筛选
	$filterSelect.mouseover(function() {
		var $this = $(this);
		var offset = $this.offset();
		var $menuWrap = $this.closest("div.menuWrap");
		var $popupMenu = $menuWrap.children("div.popupMenu");
		$popupMenu.css({left: offset.left, top: offset.top + $this.height() + 2}).show();
		$menuWrap.mouseleave(function() {
			$popupMenu.hide();
		});
	});
	
	// 筛选选项
	$filterOption.click(function() {
		var $this = $(this);
		var $dest = $("#" + $this.attr("name"));
		if ($this.hasClass("checked")) {
			$dest.val("");
		} else {
			$dest.val($this.attr("val"));
		}
		$listForm.submit();
		return false;
	});
	
	// 打印选择
	$print.change(function() {
		var $this = $(this);
		if ($this.val() != "") {
			window.open($this.val());
		}
	});

});
</script>
</head>
<body>
	<div class="path">
		<a href="${ctx}/admin_Admin_index.action">首页</a> &raquo; 列表 <span>(共<span id="pageTotal">${ls.rowCount }</span>条记录)</span>
	</div>
	<form id="listForm" action="${ctx}/admin_Demo_list.action" method="post">
		<input type="hidden" value="" name="orderStatus" id="orderStatus" />
		<input type="hidden" value="" name="paymentStatus" id="paymentStatus" />
		<input type="hidden" value="" name="shippingStatus" id="shippingStatus" />
		<input type="hidden" value="" name="hasExpired" id="hasExpired" />
		<div class="bar">
			<a href="add.jhtml" class="iconButton"><span class="addIcon">&nbsp;</span>添加</a>
			<div class="buttonWrap">
				<a class="iconButton disabled" id="deleteButton" url="${ctx}/admin_Demo_delete.action" href="javascript:;"><span class="deleteIcon">&nbsp;</span>删除</a>
				<a class="iconButton" id="refreshButton" href="javascript:;"><span class="refreshIcon">&nbsp;</span>刷新</a>
				<div class="menuWrap">
					<a class="button" id="pageSizeSelect" href="javascript:;">每页显示<span class="arrow">&nbsp;</span></a>
					<div class="popupMenu" style="left: 220px; top: 59px; display: none;">
						<ul id="pageSizeOption">
							<li><a val="10" href="javascript:;">10</a></li>
							<li><a val="20" class="current" href="javascript:;">20</a></li>
							<li><a val="50" href="javascript:;">50</a></li>
							<li><a val="100" href="javascript:;">100</a></li>
						</ul>
					</div>
				</div>
			</div>
			起始日期: <input type="text" onfocus="WdatePicker({maxDate: '#F{$dp.$D(\'endDate\')}'});" value="${param.beginDate }" class="text Wdate" name="beginDate" id="beginDate" />
			结束日期: <input type="text" onfocus="WdatePicker({minDate: '#F{$dp.$D(\'beginDate\')}'});" value="${param.endDate }" class="text Wdate" name="endDate" id="endDate" />
			<input type="submit" value="确&nbsp;&nbsp;定" class="button" />
		</div>
		
		<table id="listTable" class="list">
			<tr>
				<th class="check"><input type="checkbox" id="selectAll" /></th>
				<th><span>编号</span></th>
				<th><a href="javascript:;" class="sort" name="sn">姓名</a></th>
				<th><span>年龄</span></th>
				<th><a href="javascript:;" class="sort" name="member">性别</a></th>
				<th><a href="javascript:;" class="sort" name="consignee">状态</a></th>
				<th><a href="javascript:;" class="sort" name="paymentMethodName">创建时间</a></th>
				<th><span>操作</span></th>
			</tr>
			<c:forEach items="${ls.items}" var="obj">
			  <tr>
					<td><input type="checkbox" value="${obj.id }" name="ids" /></td>
					<td>${obj.id }</td>
					<td>${obj.name }</td>
					<td>${obj.age }</td>
					<td>${obj.sex }</td>
					<td>${obj.status }</td>
					<td><fmt:formatDate value="${obj.create_time }" pattern="yyyy-MM-dd HH:mm" /></td>
					<td>
						<a href="${ctx}/admin_Demo_list.action?id=573">[查看]</a>
						<a href="${ctx}/admin_Demo_edit.action?id=573">[编辑]</a>
					</td>
				</tr>
			</c:forEach>
		</table>
		
		<c:set value="${ls}" var="page"></c:set>
		<%@ include file="/common/pages.jsp"%>
	
	</form>
</body>
</html>